//
//  ComboPageController.m
//  NVAReader
//
//  Created by DuyLK on 6/16/14.
//  Copyright (c) 2014 com.nva.nvareader. All rights reserved.
//

#import "ComboPageController.h"

@implementation ComboPageController
-(id) init
{
    self = [super init];
    if (self) {
        
    }
    return  self;
}

-(id)initWithNumberPage:(int)numberPage
{
    self = [super init];
    if (self) {
        data = [[NSMutableArray alloc] init];
        for( NSInteger i = 0; i < numberPage; i++ )
        {
            NSString *title = [[NSString alloc] initWithFormat: @"%ld/%d", i +1,numberPage];
            [data addObject:title];
        }
    }
    return  self;
}
-(id)initWithZoomPage
{
    self = [super init];
    if (self) {
        data = [[NSMutableArray alloc] init];
        [data addObject:@"Fit Width"];
        [data addObject:@"Fit Height"];
        [data addObject:@"8.33%"];
        [data addObject:@"12.5%"];
        [data addObject:@"25%"];
        [data addObject:@"33.33%"];
        [data addObject:@"50%"];
        [data addObject:@"66.67%"];
        [data addObject:@"75%"];
        [data addObject:@"100%"];
        [data addObject:@"125%"];
        [data addObject:@"150%"];
        [data addObject:@"200%"];
        [data addObject:@"300%"];
        [data addObject:@"400%"];
        [data addObject:@"600%"];
        [data addObject:@"800%"];
        [data addObject:@"1200%"];
        [data addObject:@"1600%"];
        [data addObject:@"3200%"];
        [data addObject:@"6400%"];
    }
    return self;
}
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index {
    return [data objectAtIndex:index];
}


- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox {
    return [data count];
}

- (NSUInteger)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)string {
    return [data indexOfObject:string];
}
@end
